home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / bsd / rpcsvc / ether.h < prev    next >
C/C++ Source or Header  |  1990-01-29  |  2KB  |  84 lines

  1. /*    @(#)ether.h    1.2 88/05/08 4.0NFSSRC SMI    */
  2.  
  3. /* 
  4.  * Copyright (c) 1988 by Sun Microsystems, Inc.
  5.  * @(#) from SUN 1.5
  6.  */
  7.  
  8. #define NPROTOS 6
  9. #define NDPROTO 0
  10. #define ICMPPROTO 1
  11. #define UDPPROTO 2
  12. #define TCPPROTO 3
  13. #define ARPPROTO 4
  14. #define OTHERPROTO 5
  15.  
  16. #define NBUCKETS 16
  17. #define MINPACKETLEN 60
  18. #define MAXPACKETLEN 1514
  19. #define BUCKETLNTH ((MAXPACKETLEN - MINPACKETLEN + NBUCKETS - 1)/NBUCKETS)
  20.  
  21. #define HASHSIZE 256
  22.  
  23. #define ETHERSTATPROC_GETDATA 1
  24. #define ETHERSTATPROC_ON 2
  25. #define ETHERSTATPROC_OFF 3
  26. #define ETHERSTATPROC_GETSRCDATA 4
  27. #define ETHERSTATPROC_GETDSTDATA 5
  28. #define ETHERSTATPROC_SELECTSRC 6
  29. #define ETHERSTATPROC_SELECTDST 7
  30. #define ETHERSTATPROC_SELECTPROTO 8
  31. #define ETHERSTATPROC_SELECTLNTH 9
  32. #define ETHERSTATPROG 100010
  33. #define ETHERSTATVERS 1
  34.  
  35. int xdr_etherstat();
  36. int xdr_etherhbody();
  37. int xdr_etherhmem();
  38. int xdr_etherhtable();
  39. int xdr_etheraddrs();
  40. int xdr_addrmask();
  41.  
  42. /*
  43.  * all ether stat's except src, dst addresses
  44.  */
  45. struct etherstat {
  46.     struct timeval    e_time;
  47.     unsigned long    e_bytes;
  48.     unsigned long    e_packets;
  49.     unsigned long    e_bcast;
  50.     unsigned long    e_size[NBUCKETS];
  51.     unsigned long    e_proto[NPROTOS];
  52. };
  53.  
  54. /*
  55.  * member of address hash table
  56.  */
  57. struct etherhmem {
  58.     int ht_addr;
  59.     unsigned ht_cnt;
  60.     struct etherhmem *ht_nxt;
  61. };
  62.  
  63. /*
  64.  * src, dst address info
  65.  */
  66. struct etheraddrs {
  67.     struct timeval    e_time;
  68.     unsigned long    e_bytes;
  69.     unsigned long    e_packets;
  70.     unsigned long    e_bcast;
  71.     struct etherhmem **e_addrs;
  72. };
  73.  
  74. /*
  75.  * for size, a_addr is lowvalue, a_mask is high value
  76.  */
  77. struct addrmask {
  78.     int a_addr;
  79.     int a_mask;        /* 0 means wild card */
  80. };
  81.  
  82. extern char *protoname[];
  83. extern int if_fd;
  84.